package com.adcc.monitoragent.show;

import org.apache.log4j.PropertyConfigurator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adcc.monitoragent.show.bean.WatchBean;
import com.adcc.monitoragent.show.receive.MessageReceive;
import com.adcc.monitoragent.show.service.MessageService;
import com.adcc.monitoragent.util.ProtertiesUtil;

public class MainShow {

	private final static Logger log = LoggerFactory.getLogger(MainShow.class);
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// 配置log4j
		PropertyConfigurator.configure("conf/log4j.properties");
		// 初始化属性工具参数
		ProtertiesUtil.init();
		//初始化监控集群
		WatchBean.initWatch(ProtertiesUtil.getShowClusterNames(), ProtertiesUtil.getRecivePort(),
				ProtertiesUtil.getInterestMqMetrics(),ProtertiesUtil.getMaxMqQueueNumber(),
				ProtertiesUtil.getShowLogPathParent(), ProtertiesUtil.getShowLogPaths(),
				ProtertiesUtil.isShowDynamic(), ProtertiesUtil.getInitNodeConfig());
		//启动汇总线程
		MessageService.sumMessageThread();
		
		// 传输连接初始化
		MessageReceive.init();
		log.info("系统启动成功");
	}

}
